-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging NATS .NET Client Library v1 and v2 Packages into a Unified >v2.4.x #601
Conversation
This is to enable mixing v1 and v2 clients. If users want to use both versions in the same application, then they should avoid referencing this package.
Copied from commit 1de50660
2fa2542
to
a79d93e
Compare
I copied V1 code into my V2 project and it worked no problem. This approach seems to provide the least bumpy transition, imo. LGTM! |
|
no. we're trying to leverage NATS.Client popularity to increase v2 / NATS .NET adoption.
it's confusing for people. search on https://www.nuget.org/
that is really what we're to do. trying to accelerate that time.
yes. it's v1 users who will be affected an need support, but once this is done then everyone will be on the same page more or less, rather than having confusing nuget packages for another 5 years.
that is true. we already have multiple packages with v2 and the management approach is to keep them all on the same version to avoid version compatibility matrix etc. I don't believe it would be a problem especially considering the release frequency of v1. |
So I don't agree with the answers to (1) and (2). Based on web search, we know that it's not an issue. Based on Nuget, V1 comes up first in the listing, V2 is 4th, 5th and 6th, and matches the name NATS.Client which is really confusing to me since I would think that's part of V1. (Which I realize is an argument for the change, but that problem was created/pre-existing.) (3) Doesn't matter where the code is, the customer is just putting the software in the field this year, 5 years doesn't seem out of the question. (4) Maybe it won't negatively affect V1 users. Maybe it will actually encourage migration. I'm not actually sure how this pushes the needle either direction. (5) Consider if you will, an application using 1.1.6 (the current V1). Now there are bug fixes and features that get added to v1 and we would have minor versioned it. 1.2.0 doesn't exist but 2.x.x does. Wait a second, I have to MAJOR version to get these fixes. At this point I'm unaware that the V1 api is fully supported in V2, and the changes are part of V2. This is a major barrier to entry, it's almost like support is completely gone. Sure, I could RTFM, but who does that. I think you see where I'm going. At the end of the day 2 things. 1) Maybe I'm making a mountain out of a molehill, it wouldn't be the first time. 2) If the decision is to make this change, I'll live with it and I'll support it. There will or won't be issues, if there are we'll just deal with it. |
I chatted with @mtmk for quite a while, and we agree that on this particular release it probably doesn't matter - however it does make semver not useful (except when tagging outdated). My preferred would be that 2.x doesn't include 1.x, and share the Nuget name, but are API major version change - either way there will be some issue either way. |
Along the same lines as Alberto...
The upside of this is that V2 gets the benefit of V1 in the Nuget directory. The downside is that any V1 developer that has automatic updating of Nuget probably will fail a build. But I can't think of anyone who does that. Thinking about our 3 biggest corporate customers, they will never upgrade versions automatically, they will only ever upgrade to a specific version. This also eliminates the semver issue as both will be completely independant. |
This was the original suggestion now we came full circle back to #600 to reiterate this is making life easier for v1 users. some will try to update to latest. why break their code regardless of what we might think about semver?. second we will have to make sure we only publish a meta NATS.Client package from v2 not to break it for projects using both and users need to be careful with the versions numbers of NATS.Client and not use v2 of that package if mixing both APIs for some reason. Just to thrown in the mix they might be using other packages that require v1 and v2 which might lead to unresolvable package conflicts. so the down side is we're going to make an extra release once in a while. |
DON'T Share the Nuget Name either It is fine to not combine repos, but you cannot have namespace/dll/nuget collisions between the v1 and v2 client repos. If you do you cause the issue called out in #600 (comment) even if the version number is properly updated to 2.x or anything else since .Net only allows one dll to be named Nats.Client.dll. v1 can be Nats.Client and v2 can be Nats.Net just fine. In larger companies, the library developers and service developers are often on different teams/orgs/regions and having nuget/dll overlaps can cause significant cost to the orgs when one team decides to begin using the v2 client and another team does not. Having an overlap effectively creates a production blocking bug to all .Net services that use NATS. |
see #600 |
This pull request consolidates the NATS .NET client libraries' v1 and v2 functionalities into a unified set of packages under the
nats-io/nats.net
repository. The primary goal is to offer both v1 and v2 functionalities within theNATS.Client
package while centralizing package management and promoting v2 features.This change does not impact existing v2 applications, except when referencing
NATS.Net
package in which case there will be minor dependency changes explained below.Note: Merging this PR won't publish NuGet packages. That will be done in a follow up PR.
Key Changes
NATS.Client
Package:NATS.Client.Simplified
,NATS.Client.Core
, andNATS.Client.Serialization.Json
.NATS.Client
2.x.x can continue using v1 functionality without worrying about breaking changes.NATS.Client.JetStream
package, which is a natural step for developers familiarizing themselves with the ecosystem.NATS.Client.Simplified
Package (new):NATS.Client.Core
andNATS.Client.Serialization.Json
.NATS.Client.Core
, to maintain AOT support and avoid introducing theNATS.Client.Serialization.Json
dependency.NATS.Net
Package:NATS.Client.Simplified
andNATS.Client.Serialization.Json
.Namespace Clashes:
NATS.Client.JetStream
. Since v2 classes also follow theNats*
prefix convention type name conflicts are avoided.NATS.Client.Compatv1v2.Test
demonstrates and confirms that namespace clashes are not an issue.Target Framework Changes (v1):
netstandard2.0
for v1 users, droppingnetstandard1.6
andnet46
targets.NATS.Client
v2.x.x, v1 users will pull down three additional DLLs:NATS.Client.Core.dll
(473 KB)NATS.Client.Serializers.Json.dll
(9 KB)NATS.Client.Simplified.dll
(10 KB)System.Text.Json
, alongside the main DLLNATS.Client.dll
(609 KB).Benefits
NATS.Client
via Visual Studio will seamlessly use v2 functions as documented, without surprises.NATS.Client
will primarily serve developers who access NuGet directly without consulting documentation.Rationale
This unified approach allows us to streamline user support, improve adoption rates, and simplify the transition process for existing users. By maintaining a single set of packages, we enhance user experience while ensuring that the most popular package on NuGet continues to serve its existing user base effectively.
Request for Feedback
Please review the proposed changes and provide your feedback. We aim to address any potential issues and ensure a smooth transition for our users.